#ifndef AGRV2K_H
#define AGRV2K_H

#include "common/tusb_common.h"
#include "alta.h"

#define FRAME_LIST_SIZE 256
#define SET_FRAME_LIST_SIZE0(__size) USB_SetFrameListSize(USB_FRAME_LIST_##__size)
#define SET_FRAME_LIST_SIZE(__size) SET_FRAME_LIST_SIZE0(__size) // To have __size expand once first

#define QHD_MAX (USB_ENDPOINTS * 2)
typedef union {
#if TUSB_OPT_DEVICE_ENABLED
  struct {
    USB_DQH dQH[QHD_MAX] TU_ATTR_ALIGNED(64);
    USB_DTD dTD[QHD_MAX] TU_ATTR_ALIGNED(32); // 1 TD for each QH
  };
#endif
#if TUSB_OPT_HOST_ENABLED
  // Host controller data is defined in portable/ehci/ehci.h
#endif
} USB_DataTypeDef;

extern USB_DataTypeDef usb_data;

#endif
